package com.zking.service.impl;

import com.zking.dao.domain.Patient;
import com.zking.dao.mapper.PatientMapper;
import com.zking.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Tanglei
 * @date 2020/8/20 - 14:25
 */
@Service
public class PatientServiceImpl implements PatientService {

    @Autowired
    PatientMapper patientMapper;

    @Override
    public List<Patient> queryPatients() {
        List<Patient> patients = patientMapper.queryPatients();
        return patients;
    }

    @Override
    public Patient queryOnePatient(Integer id) {
        Patient patient = patientMapper.queryOnePatient(id);
        return patient;
    }

    @Override
    public Boolean updatePatient(Patient patient) {
        Boolean aBoolean = patientMapper.updatePatient(patient);
        return aBoolean;
    }

    @Override
    public int queryPatientCount() {
        return patientMapper.queryPatientCount();
    }
}
